/* 重置和基础样式 */
html, body, #app {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 容器填满屏幕高度，flex布局垂直方向 */
.my-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #fff;
  color: #333;
}

/* 顶部栏 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 👈 左对齐 */
  padding: 15px 30px;
  background-color: var(--header-bg-color, #f8d3e5);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px; /* 控件间距 */
}


/* 主题选择框 */
.theme-selector {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.theme-selector:hover, .theme-selector:focus {
  border-color: #999;
  outline: none;
}

/* 个人信息区 */
.profile-section {
  display: flex;
  align-items: center;
  padding: 24px;
  background-color: white;
  border-bottom: 1px solid #eee;
  gap: 24px;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
}

.username {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.bio {
  font-size: 16px;
  color: #777;
  margin-bottom: 16px;
}

.stats {
  display: flex;
  gap: 40px;
  font-size: 16px;
  color: var(--primary-color);
}

.stats div {
  text-align: center;
}

.stats strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

/* 帖子列表 */
.posts-section {
  flex-grow: 1;
  padding: 20px 24px;
  background-color: white;
  overflow-y: auto;
  min-height: 0; /* flex内部滚动必备 */
  display: flex;
  flex-direction: column;
}

.posts-section h3 {
  color: var(--primary-color);
  margin-bottom: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.posts-grid {
  background-color: var(--posts-bg, #fff);
  padding: 20px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  overflow-y: auto;
  min-height: 400px;
}

/* 空白占位格 */
.post-placeholder {
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.post-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgb(229 106 148 / 0.3);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
}

.post-item:hover {
  box-shadow: 0 6px 12px rgb(229 106 148 / 0.5);
}

.post-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.post-desc {
  padding: 12px;
  font-size: 14px;
  color: #555;
  min-height: 48px;
}

.no-posts {
  grid-column: span 3;
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 40px 0;
}

.back-button {
  margin-left: 10px;
  padding: 6px 12px;
  background-color: var(--primary-color, #ccc);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.back-button:hover {
  background-color: var(--primary-hover, #aaa);
}


/* --- 主题色定义 --- */
:root {
  --primary-color-pink: #d1456a;
  --top-bar-bg-pink: #ffe4ec;
  --top-bar-text-pink: #d1456a;

  --primary-color-blue: #3a80ba;
  --top-bar-bg-blue: #d6e8ff;
  --top-bar-text-blue: #3a80ba;

  --primary-color-green: #3a9d5d;
  --top-bar-bg-green: #d6f2d8;
  --top-bar-text-green: #3a9d5d;
}

/* 粉色主题 */
.theme-pink {
  --primary-color: var(--primary-color-pink);
  --top-bar-bg: var(--top-bar-bg-pink);
  --top-bar-text: var(--top-bar-text-pink);
  --posts-bg:var(--primary-color-pink);
}

/* 蓝色主题 */
.theme-blue {
  --primary-color: var(--primary-color-blue);
  --top-bar-bg: var(--top-bar-bg-blue);
  --top-bar-text: var(--top-bar-text-blue);
  --posts-bg:var(--primary-color-blue);
}

/* 绿色主题 */
.theme-green {
  --primary-color: var(--primary-color-green);
  --top-bar-bg: var(--top-bar-bg-green);
  --top-bar-text: var(--top-bar-text-green);
  --posts-bg:var(--primary-color-green);
}

.pagination-container {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.pagination-container button {
  padding: 6px 14px;
  background-color: #f06292;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pagination-container button:hover:not(:disabled) {
  background-color: #ec407a;
}

.pagination-container button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.page-info {
  font-weight: bold;
}
.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.post-actions button {
  padding: 4px 10px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.post-actions button:hover {
  opacity: 0.8;
}
/* --- 编辑 & 删除按钮 --- */
.post-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.edit-btn,
.delete-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-btn {
  background-color: #4caf50;
  color: white;
}

.edit-btn:hover {
  background-color: #45a049;
}

.delete-btn {
  background-color: #f44336;
  color: white;
}

.delete-btn:hover {
  background-color: #d32f2f;
}

/* --- 悬浮窗模态框样式 --- */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-container {
  background: white;
  padding: 24px 28px;
  border-radius: 12px;
  width: 400px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
}

.modal-input,
.modal-textarea {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.save-btn,
.cancel-btn {
  padding: 6px 14px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.save-btn {
  background-color: #1976d2;
  color: white;
}

.save-btn:hover {
  background-color: #1565c0;
}

.cancel-btn {
  background-color: #e0e0e0;
}

.cancel-btn:hover {
  background-color: #d5d5d5;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

